using Entitas;
using UnityEngine;

public class TickSystem : IExecuteSystem, IInitializeSystem
{
    LogicContext mContext;

    public TickSystem(LogicContext contexts)
    {
        mContext = contexts;
    }

    public void Initialize()
    {
        mContext.ReplaceTick(1);
    }
    
    public void Execute()
    {
        int tick = mContext.tick.Value + 1;
        mContext.ReplaceTick(tick);
    }
}
